package com.fengxing.ams.pub;

import com.fengxing.ams.pub.dto.ResultDTO;

/**
 * CTMSException类 异常处理
 * 
 * @author Administrator
 * @version CTMS V100R001 2011-8-10
 * @since CTMS V100R001C01
 */
public class AMSException extends RuntimeException {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = -4838261761137055672L;

	/**
	 * 错误信息，对应CTMS中接口说明文档中的错误码定义
	 */
	private ResultDTO resultVO;

	/**
	 * 构造函数。
	 * 
	 */
	public AMSException() {
		super();
	}
	
    public AMSException(final String msg) {
        super(msg);
    }

    public AMSException(final String msg, final Throwable ex) {
        super(msg, ex);
    }
    
	public AMSException(Long resultCode, Throwable cause, Object... message) {
		super(cause);
		this.resultVO = new ResultDTO(resultCode);
	}

	public AMSException(ResultDTO resultVO) {
		this.resultVO = resultVO;
	}

	public AMSException(Long resultCode, Object... message) {
		this.resultVO = new ResultDTO(resultCode);
	}

	public AMSException(Long resultCode, String resultDesc) {
		this.resultVO = new ResultDTO(resultCode);
		resultVO.setMessage(resultDesc);
	}
	
	public AMSException(Long resultCode) {
		this.resultVO = new ResultDTO(resultCode);
	}

	/**
	 * 获取resultVO
	 * 
	 * @return 返回resultVO
	 */
	public ResultDTO getResultVO() {
		return resultVO;
	}

}
